package com.pine.app.module.security.oauth.plugin;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author xiaoyuan
 * @create 2020/3/6
 **/
public interface ProcessPluginChain {

    /**
     * 订阅操作
     */
    void attach(ProcessPlugin observer);

    /**
     * 取消订阅操作
     */
    void detach(ProcessPlugin observer);

    void attachAll(List<ProcessPlugin> list) ;

    /**
     * 前置处理操作
     * @param request
     * @param response
     */
   void prepare(HttpServletRequest request, HttpServletResponse response, Object o, Plugin plugin);

    /**
     * 后置处理操作
     * @param request
     * @param response
     */

    void complete(HttpServletRequest request, HttpServletResponse response,Object o, Plugin plugin);

    /**
     *  异常处理
     * @param request
     * @param response
     * @param e
     */

    void  exception(HttpServletRequest request, HttpServletResponse response,Exception e, Plugin plugin);
}
